using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Castle.ActiveRecord;

namespace IronMis2.Models
{
    [ActiveRecord("item")]
    public class Item : ActiveRecordBase<Item>
    {
        private Guid id;
        private string itemNam;
        private string itemSummary;
        private decimal itemMoney;
        private Payout payout;
        private string itemID;
        private Income income;

        [Property(Column = "item_name", SqlType = "varchar", Length = 50)]
        public string ItemNam
        {
            set { itemNam = value; }
            get { return itemNam; }
        }

        [Property(Column = "item_summary", SqlType = "varchar", Length = 50)]
        public string ItemSummary
        {
            set { itemSummary = value; }
            get { return itemSummary; }
        }

        [Property(Column = "item_id", SqlType = "char", Length = 10)]
        public string ItemID
        {
            set { itemID = value; }
            get { return itemID; }
        }

        [BelongsTo(Column = "payout_id", ForeignKey = "id", Insert = true, Update = true, Fetch = FetchEnum.Select)]
        public Payout Payout
        {
            set { payout = value; }
            get { return payout; }
        }

        [BelongsTo(Column = "income_id", ForeignKey = "id", Insert = true, Update = true, Fetch = FetchEnum.Select)]
        public Income Income
        {
            set { income = value; }
            get { return income; }
        }

        [Property(Column = "item_money", SqlType = "decimal", Length = 9)]
        public decimal ItemMoney
        {
            set { itemMoney = value; }
            get { return itemMoney; }
        }

        [PrimaryKey(PrimaryKeyType.GuidComb, Column = "id")]
        public Guid ID
        {
            set { id = value; }
            get { return id; }
        }
    }
}
